package com.xiaowan.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

//@Component
//@Aspect
public class UserAspect {
    @Pointcut(value="execution(* com.xiaowan.service.*.*(..))")
    public void pointCut(){ }

//    @Before(value = "pointCut()")
//    public void doBefore(JoinPoint joinPoint){
//        String methodName = joinPoint.getSignature().getName();
//        Object[] args = joinPoint.getArgs();
//        System.out.println(methodName + "------" + args[0]);
//    }
//    @After(value="pointCut()")
//    public void doAfter(JoinPoint joinPoint){
//        String methodName = joinPoint.getSignature().getName();
//        System.out.println(methodName + "------");
//    }
//
//    @AfterReturning(value="pointCut()",returning="obj")
//    public void afterReturning(JoinPoint joinPoint,Object obj){
//        System.out.println(obj);
//    }

//    @Around(value="pointCut()")
//    public void around(ProceedingJoinPoint proceed){
//        try {
//            proceed.proceed();
//        } catch (Throwable throwable) {
//            throwable.printStackTrace();
//        }
//    }
}
